# Maintainer: Patrycja Rosa <alpine@ptrcnull.me>
pkgname=py3-jsonpickle
pkgver=3.0.4
pkgrel=0
pkgdesc="Serializing any arbitrary object graph into JSON"
url="https://pypi.org/project/jsonpickle/"
arch="noarch"
license="BSD-3-Clause"
depends="py3-tzdata"
makedepends="py3-gpep517 py3-setuptools py3-setuptools_scm py3-wheel"
checkdepends="py3-pytest py3-numpy py3-pandas"
subpackages="$pkgname-pyc"
source="https://files.pythonhosted.org/packages/source/j/jsonpickle/jsonpickle-$pkgver.tar.gz
	pandas2.patch
	"
builddir="$srcdir/jsonpickle-$pkgver"

replaces="py-jsonpickle" # Backwards compatibility
provides="py-jsonpickle=$pkgver-r$pkgrel" # Backwards compatibility

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	# ecdsa: no gmpy
	# roundtrip: breaks on 32bit
	.testenv/bin/python3 -m pytest --deselect tests/ecdsa_test.py -k 'not test_multindex_dataframe_roundtrip'
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
d4696faa12e6653a9d6dd4447f6c3d0a0f9d1fde05824f52589ce6fb8a0cdfeecfbb748f69d56f84105e56f912cc8d5e4e432f33c1a0ad6681b11e0f0df1bf63  jsonpickle-3.0.4.tar.gz
f9bfea88de20248b7f3f72633c5e189966313de858956a832c2eb9f8afb4917cb26cfbf949b6ac77f25a7e6f1683f5b8b146f6c1021cb2a63e9605ae00fe2884  pandas2.patch
"
